package com.myj.jim.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.myj.jim.dao.SysLogDao;
import com.myj.jim.domain.SysLog;
import com.myj.jim.domain.bootstraptable.BootstrapTable;
import com.myj.jim.domain.bootstraptable.BootstrapTableJSON;
import com.myj.jim.service.SysLogService;

@Service
public class SysLogServiceImpl implements SysLogService {

	@Autowired
	private SysLogDao sysLogDao;
	
	@Override
	public BootstrapTableJSON<SysLog> findPage(BootstrapTable bt) {
		
		BootstrapTableJSON<SysLog> btj = new BootstrapTableJSON<>();
		btj.setRows(sysLogDao.findPage(bt));
		btj.setTotal(sysLogDao.count());
		
		return btj;
	}

	@Override
	public void insertLog(SysLog sl) {
		sysLogDao.insert(sl);
	}

}
